package com.dwxt.cdms.controller;

import com.dwxt.cdms.base.Page;
import com.dwxt.cdms.entity.Part;
import com.dwxt.cdms.service.PartService;
import com.dwxt.common.base.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:客户角色
 * @author chendq
 * @date 2021/10/18
 */
@RequestMapping("/cdms/part")
@RestController
public class PartController {

    @Autowired
    private PartService partService;

    /**
     * 分页查询
     */
    @RequestMapping("/page")
    public BaseResult page(Page page) {
        return partService.page(page);
    }

    /**
     * 查询客户的角色
     */
    @RequestMapping("/list")
    public BaseResult list(Integer customerId) {
        return partService.list(customerId);
    }

    /**
     * 新增
     */
    @RequestMapping("/add")
    public BaseResult add(Part part) {
        return partService.add(part);
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public BaseResult delete(Integer id){
        return partService.delete(id);
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public BaseResult update(Part part){
        return  partService.update(part);
    }
}

